/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package poker.game;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * Represents the private two card hand.
 * 
 * 
 * @author Benjamin L. Brodie <blbrodie@gmail.com>
 */
public class PocketHand implements Hand{
    Card c1;
    Card c2;

    @Override
    public List<Card> getHand() {
        return new ArrayList<Card>(Arrays.asList(c1, c2));
    }

    
    //[ifPair, ifSameSuite, ifCongruent, HighCardValue] 
    @Override
    public List<Integer> getEval() {
        int ifPair = 0;
        int ifSameSuite = 0;
        int ifCongruent = 0;
        int HighCardValue =0;
        
        if (c1.getValue() == c2.getValue()){
            ifPair = 1;
        }
        
        if (c1.getSuite() == c2.getSuite()){
            ifSameSuite = 1;
        }
        
        if (c1.getValue() == c2.getValue() + 1 || c1.getValue() == c2.getValue()-1){
            ifCongruent = 1;
        }
        
        if (c1.getValue() >= c2.getValue()){
            HighCardValue = c1.getValue();
        } else{
            HighCardValue = c2.getValue();
        }
        
        
        return Arrays.asList(ifPair, ifSameSuite, ifCongruent, HighCardValue);
        
        
    }

    @Override
    public Map<Integer, Integer> asMap() {
        throw new UnsupportedOperationException("Not supported.");
    }

    @Override
    public int compareTo(Hand o) {
        throw new UnsupportedOperationException("Not supported.");
    }
    
    
    public PocketHand(Card c1, Card c2){
        this.c1 = c1;
        this.c2 = c2;
    }
    
}
